<?include_once("template.php");?>

<html>
<?echo getHeader();?>
<body>

	<div class='page-header'><h1>Select Your Team</h1></div>
	<form>
		<?
		include_once("config.php");
		session_start();
		$teamRepo = new TeamRepo();
		$draftTeamList = $teamRepo->getAllOrphanTeams();
		if (isset($draftTeamList))
		{
			foreach($draftTeamList as $draftArray)
			{
				echo "<fieldset><legend>".$draftArray["draft"]->name."</legend>";
				echo "<table class='team-table zebra-striped'>";
				foreach($draftArray["teamList"] as $team){
					echo $team->asTableRow();
				}
				echo "</table>";
			}
			echo "</fieldset>";
		}
		else
		{
			echo "There are no teams left for you to pick";
		}
		?>

			<script type='text/javascript' src='teamSelector.js'></script>
	</fieldset>
	</form>
</body>
</html>